import {
	createStore
} from 'vuex'
const store = createStore({
	state: {
		uid: '', //_id用户标识
		isHave: '', //宿舍数量
		avatar: '', //头像地址
		uname: '999', //用户名
		token: "" //令牌
	},
	getters: {
		uid(state) {
			return state.uid;
		},
		isHave(state) {
			return state.isHave;
		},
		avatar(state) {
			return state.avatar;
		},
		uname(state) {
			return state.uname;
		},
		token(state) {
			return state.token;
		}
	},
	mutations: {
		doavatar(state, obj) {
			state.avatar = obj.avatar
		},
		douname(state, obj) {
			state.uname = obj.uname
		},
		dotoken(state, obj) {
			state.token = obj.token
		}
	}
})

export default store